const http = require('http');
const fs = require('fs');
const server = http.createServer();

server.listen(5555, function () {
    console.log("留言板服务启动成功~");
})


server.on('request', function (request, response) {
    if (request.url === '/') {
        fs.readFile('./views/index.html', function (error, data) {
            if (error) {
                    response.end('加载失败')
            } else {
                  response.write('首页加载成功');
                response.end('加载成功')
                }
        })
      
    } else {
        response.end('ok')
    }
})


